MobyDog
07/08/2023, 7:53 PMMobyDog
07/08/2023, 7:53 PMvar id = $routeParams.create ? 0 : $routeParams.id;
dealerResource.getBranchById(id).then(function (response) {
$scope.branch = response.data;
if ($routeParams.create) {
$scope.branch.dbr_dlrId = $routeParams.id;
}
$scope.address = {
coordinates: {
lat: $scope.branch.dbr_latitude,
lng: $scope.branch.dbr_longitude,
postalcode: $scope.branch.dbr_postcode,
full_address: $scope.GetAddress()
},
};
alert("address lat" + $scope.address.coordinates.lat); //these now have the coordinates from the database
alert("address long" + $scope.address.coordinates.lng); // but the map doesn't reflect this
$scope.properties = [
{
label: 'Location',
description: 'Drag pin to refine location',
view: '/App_Plugins/Our.Umbraco.GMaps/views/maps.editor.html',
config: {
},
value: {
coordinates: {
lat: $scope.address.coordinates.lat,
lng: $scope.address.coordinates.lng
}
}
}
];
$scope.loaded = true;
editorState.set($scope.branch);
MobyDog
07/08/2023, 7:53 PM<div class="umb-property-editor our-coremaps" ng-class="{'our-coremaps--loading': showLoader}" ng-controller="GMapsMapsController as vm">
<div class="our-coremaps__area">
<input type="text" class="our-coremaps__autocomplete umb-property-editor umb-textstring textstring" placeholder="Type name, address or geolocation" ng-model="searchedValue" />
<div class="our-coremaps__coordinates">
<span>PinB:</span> <span>{{address.coordinates.lat}},{{address.coordinates.lng}}</span><br />
<span>Center:</span> <span>{{mapCenter.lat}},{{mapCenter.lng}}</span>
</div>
</div>
<div class="our-coremaps__canvas"></div>
<umb-load-indicator ng-show="showLoader">
</umb-load-indicator>
<div ng-show="error">{{ error }}</div>
</div>
D_Inventor
07/11/2023, 7:05 AM<umb-property>
and the <umb-property-editor>
directives for that. I have no example ready at the moment, but if you search for these tags in the Umbraco source on github, then you should be able to find some.D_Inventor
07/11/2023, 7:07 AMMobyDog
07/11/2023, 2:43 PM"propertyEditors": [
{
"alias": "Our.Umbraco.GMaps",
"name": "Google Maps Single Marker",
"icon": "icon-map-location",
"group": "Rich Content",
"editor": {
"view": "~/App_Plugins/Our.Umbraco.GMaps/views/maps.editor.html",
"valueType": "JSON"
},
"prevalues": {
"fields": [
{
"label": "Google API Key",
"description": "Your Google Maps API Key",
"key": "apikey",
"view": "textstring"
},
{
"label": "Default coordinates",
"description": "The coordinates (lat, long) of the centre this map will show. Example: 52.379189, 4.899431",
"key": "location",
"view": "textstring"
},
{
"label": "Default zoom",
"description": "The default zoom level of the map. Defaults to 17",
"key": "zoom",
"view": "number"
},
MobyDog
07/11/2023, 2:44 PM$scope.properties = [
{
label: 'Location',
description: 'Drag pin to refine location',
view: '/App_Plugins/Our.Umbraco.GMaps/views/maps.editor.html',
config: {
},
value: {
coordinates: {
lat: $scope.address.coordinates.lat,
lng: $scope.address.coordinates.lng
}
}
}
];
Are you saying I need to change that whole section to match the package.manifest?MobyDog
07/11/2023, 2:46 PM$scope.properties = [
{
label: 'Location',
description: 'Drag pin to refine location',
view: '/App_Plugins/Our.Umbraco.GMaps/views/maps.editor.html',
config: {
},
location: {
$scope.address.coordinates.lat, $scope.address.coordinates.lng
}
}
];
D_Inventor
07/11/2023, 2:55 PM<umb-property property="vm.myproperty">
<umb-property-editor model="vm.myproperty">
</umb-property-editor>
</umb-property>
Then vm.myproperty
is the object with label, description, view, config and value.D_Inventor
07/11/2023, 2:57 PMMobyDog
07/11/2023, 4:05 PM